#!/usr/bin/python

from PyQt4 import QtCore, QtGui
import subplotGUI

def run_main():
    import sys
    app = QtGui.QApplication(sys.argv)
    MainWindow = QtGui.QMainWindow()
    ui = subplotGUI.SubPlot(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())
    
def run_main2():
    import sys
    app = QtGui.QApplication(sys.argv)
    MainWindow = QtGui.QMainWindow()
    ui = subplotGUI.SubPlot(MainWindow)
    MainWindow.show()
    app.connect(app, QtCore.SIGNAL('lastWindowClosed()'), app, QtCore.SLOT('quit()'))
    app.exec_()
    #sys.exit(app.exec_())
    

if __name__ == "__main__":
    
    run_main()
    #run_main2()
##    
##    import hotshot
##    profiler = hotshot.Profile( "subplot.profile", lineevents=0 )
##    command = '''run_main()''' # your mainloop call here, this is for a Twisted app...
##    profiler.runctx( command, globals(), locals())
##    profiler.close()
